(function () {
    var exports = this;
    var $ = null;

    //原因	1.房间结算	2.管理员操作  统计
    var LAYERTP_JL = 'jilu';
    var LAYERTP_XQ = 'xiangqing';
    var LAYERTP_TJ = 'tongji';
    var NumOfPage = 30;

    var ClubPowerListLayer = cc.Layer.extend({
        ctor: function (clubid) {
            this._super();
            var that = this;
            this._clubid = clubid;

            var clubData = ClubDataManager.getClubData(this._clubid);
            this._isAdmin = isAdmin(clubData);

            loadNodeCCS(res.ClubPowerListLayer_json, this);
            $ = create$(this.getChildByName('Node'));

            this.layertype = LAYERTP_JL;

            this.initUI();
            return true;
        },
        initUI: function () {
            var that = this;

            var today = new Date();
            var curyear = today.getFullYear();
            var curmonth = today.getMonth() + 1;
            var curday = today.getDate();
            this._curyear = curyear;
            this._curmonth = curmonth;
            this._curday = curday;
            this._curPage = 0;
            this._allPage = 0;
            this._searchUid = 0;
            $('root.mytili').setString('');
            $('root.node_xiangqing.datebg.txt').setString(curday + '/' + curmonth + '/' + curyear);
            $('root.node_tongji.datebg_from.txt').setString(curday + '/' + curmonth + '/' + curyear);
            $('root.node_tongji.datebg_to.txt').setString(curday + '/' + curmonth + '/' + curyear);
            that._today = this.getYesToday(0);

            $('root.node_xiangqing.idbg').setVisible(this._isAdmin);
            $('root.node_xiangqing.btn_search').setVisible(this._isAdmin);
            $('root.node_xiangqing.btn_cancel').setVisible(this._isAdmin);

            TouchUtil.setOnclickListener($('root.btn_close'), function () {
                that.removeFromParent();
            });
            // 统计界面
            TouchUtil.setOnclickListener($('root.node_tongji.btn_qiri'), function () {
                $('root.node_tongji.datebg_to.txt').setString(that._today.day + '/' + that._today.month + '/' + that._today.year);
                var day7beforetoday = that.getYesToday(7);
                $('root.node_tongji.datebg_from.txt').setString(day7beforetoday.day + '/' + day7beforetoday.month + '/' + day7beforetoday.year);
                //最近七日
                var dayBefore7 = that.getYesToday(7);
                that.sendReq(that._curyear, that._curmonth, that._curday, LAYERTP_TJ, {
                    year: dayBefore7.year,
                    month: dayBefore7.month,
                    day: dayBefore7.day
                });
            });
            TouchUtil.setOnclickListener($('root.node_tongji.btn_search'), function () {
                var riqifrmo = $('root.node_tongji.datebg_from.txt').getString();
                var riqito = $('root.node_tongji.datebg_to.txt').getString();
                // console.log(riqifrmo);
                // console.log(riqito);
                var riqifrmoArr = riqifrmo.split('/');
                var riqitoArr = riqito.split('/');
                that.sendReq(riqitoArr[2], riqitoArr[1], riqitoArr[0], LAYERTP_TJ,
                    {year: riqifrmoArr[2], month: riqifrmoArr[1], day: riqifrmoArr[0]});
            });
            TouchUtil.setOnclickListener($('root.node_tongji.btn_datefrom'), function () {
                var riqi = $('root.node_tongji.datebg_from.txt').getString();
                var riqiarr = riqi.split('/');
                var callback = function (year, month, day) {
                    that.setDateStrTJFrom(year, month, day);
                };
                var riqito = $('root.node_tongji.datebg_to.txt').getString();
                var riqitoarr = riqito.split('/');
                that.addChild(new ClubPowerDate(riqiarr[2], riqiarr[1], riqiarr[0], callback, null, riqitoarr));
            });
            TouchUtil.setOnclickListener($('root.node_tongji.datebg_from'), function () {
                var riqi = $('root.node_tongji.datebg_from.txt').getString();
                var riqiarr = riqi.split('/');
                var callback = function (year, month, day) {
                    that.setDateStrTJFrom(year, month, day);
                };
                var riqito = $('root.node_tongji.datebg_to.txt').getString();
                var riqitoarr = riqito.split('/');
                that.addChild(new ClubPowerDate(riqiarr[2], riqiarr[1], riqiarr[0], callback, null, riqitoarr));
            });
            TouchUtil.setOnclickListener($('root.node_tongji.btn_dateto'), function () {
                var riqi = $('root.node_tongji.datebg_to.txt').getString();
                var riqiarr = riqi.split('/');
                var riqifrom = $('root.node_tongji.datebg_from.txt').getString();
                var riqifromarr = riqifrom.split('/');
                var callback = function (year, month, day) {
                    that.setDateStrTJTo(year, month, day);
                };
                that.addChild(new ClubPowerDate(riqiarr[2], riqiarr[1], riqiarr[0], callback, riqifromarr));
            });
            TouchUtil.setOnclickListener($('root.node_tongji.btn_dateto'), function () {
                var riqi = $('root.node_tongji.datebg_to.txt').getString();
                var riqiarr = riqi.split('/');
                var riqifrom = $('root.node_tongji.datebg_from.txt').getString();
                var riqifromarr = riqifrom.split('/');
                var callback = function (year, month, day) {
                    that.setDateStrTJTo(year, month, day);
                };
                that.addChild(new ClubPowerDate(riqiarr[2], riqiarr[1], riqiarr[0], callback, riqifromarr));
            });

            //今日  昨日  前日
            TouchUtil.setOnclickListener($('root.node_xiangqing.btn_today'), function () {
                var curyear = that._today.year;
                var curmonth = that._today.month;
                var curday = that._today.day;
                that._curyear = curyear;
                that._curmonth = curmonth;
                that._curday = curday;

                that._curPage = 0;
                that.sendReq(curyear, curmonth, curday, that.layertype);

                $('root.node_xiangqing.datebg.txt').setString(curday + '/' + curmonth + '/' + curyear);
            });
            //btn_left
            $('root.node_xiangqing.txt_page').setString('');
            TouchUtil.setOnclickListener($('root.node_xiangqing.btn_left'), function () {
                if (that._curPage > 0) {
                    that._curPage--;
                    that.sendReq(that._curyear, that._curmonth, that._curday, that.layertype);
                }
            });
            TouchUtil.setOnclickListener($('root.node_xiangqing.btn_right'), function () {
                if (that._curPage < (that._allPage - 1)) {
                    that._curPage++;
                    that.sendReq(that._curyear, that._curmonth, that._curday, that.layertype);
                }
            });
            TouchUtil.setOnclickListener($('root.node_xiangqing.btn_search'), function () {
                var st = that.getChildByName('searchTxt').getString();
                if (!st) {
                    showAlert('请输入要搜索的id或者昵称');
                    return;
                }
                var reg = new RegExp('^[0-9]*$');
                if (!reg.test(st)) {
                    showAlert('请输入用户的ID');
                    return;
                }
                that._curPage = 0;
                that._searchUid = st;
                that.sendReq(that._curyear, that._curmonth, that._curday, that.layertype);
            });
            TouchUtil.setOnclickListener($('root.node_xiangqing.btn_cancel'), function () {
                that.getChildByName('searchTxt').setString('');
                that._searchUid = 0;
                that._curPage = 0;
                that.sendReq(that._curyear, that._curmonth, that._curday, that.layertype);
            });

            TouchUtil.setOnclickListener($('root.node_xiangqing.btn_date'), function () {
                var riqi = $('root.node_xiangqing.datebg.txt').getString();
                var riqiarr = riqi.split('/');
                var callback = function (year, month, day) {
                    that.setDateStr(year, month, day);
                };
                that.addChild(new ClubPowerDate(riqiarr[2], riqiarr[1], riqiarr[0], callback));
            });
            TouchUtil.setOnclickListener($('root.node_xiangqing.datebg'), function () {
                var riqi = $('root.node_xiangqing.datebg.txt').getString();
                var riqiarr = riqi.split('/');
                var callback = function (year, month, day) {
                    that.setDateStr(year, month, day);
                };
                that.addChild(new ClubPowerDate(riqiarr[2], riqiarr[1], riqiarr[0], callback));
            });

            $('root.btn_xiangqing').getChildByName('on').setVisible(false);
            $('root.btn_jilu').getChildByName('on').setVisible(true);
            $('root.btn_tongji').getChildByName('on').setVisible(false);
            $('root.btn_xiangqing').setLocalZOrder(1);
            $('root.btn_jilu').setLocalZOrder(3);
            $('root.btn_tongji').setLocalZOrder(1);
            $('root.info_jilu').setVisible(true);
            $('root.info_xiangqing').setVisible(false);
            $('root.info_tongji').setVisible(false);
            $('root.node_xiangqing').setVisible(true);
            $('root.node_tongji').setVisible(false);
            if (!this._isAdmin) {
                $('root.btn_tongji').setVisible(false);
                $('root.btn_xiangqing').setPositionX(1280 * 0.43);
                $('root.btn_jilu').setPositionX(1280 * 0.57);
            }
            TouchUtil.setOnclickListener($('root.btn_jilu'), function () {
                if (that.layertype == LAYERTP_JL) {
                    return;
                }
                that.setCurLayer(LAYERTP_JL);
            });
            TouchUtil.setOnclickListener($('root.btn_xiangqing'), function () {
                if (that.layertype == LAYERTP_XQ) {
                    return;
                }
                that.setCurLayer(LAYERTP_XQ);
            });
            TouchUtil.setOnclickListener($('root.btn_tongji'), function () {
                if (that.layertype == LAYERTP_TJ) {
                    return;
                }
                that.setCurLayer(LAYERTP_TJ);
            });

            if (this._isAdmin) {
                var changebgtxt = new cc.EditBox(cc.size(230, 30),
                    new cc.Scale9Sprite(club.res.transparent_64x64_png));
                this.addChild(changebgtxt);
                changebgtxt.setName('searchTxt');
                changebgtxt.setPosition(cc.p($('root.node_xiangqing.idbg').getPositionX() + 18 + (cc.winSize.width / 2 - 1280 / 2),
                    $('root.node_xiangqing.idbg').getPositionY() + 2 + (cc.winSize.height / 2 - 720 / 2)));
                changebgtxt.setFontColor(cc.color(255, 255, 255));
                changebgtxt.setPlaceholderFontColor(cc.color(175, 133, 108));
                changebgtxt.setDelegate(this);
                changebgtxt.setMaxLength(20);
                changebgtxt.setFontSize(26);
                changebgtxt.setPlaceholderFontSize(26);
                this.changebgtxt = changebgtxt;
                changebgtxt.setPlaceHolder('输入用户ID搜索');
            }

            this.sendReq(curyear, curmonth, curday, LAYERTP_JL);
        },
        setCurLayer: function (tmpl) {
            var that = this;
            $('root.btn_xiangqing').setLocalZOrder(tmpl == LAYERTP_XQ ? 3 : 2);
            $('root.btn_jilu').setLocalZOrder(tmpl == LAYERTP_JL ? 3 : (tmpl == LAYERTP_TJ ? 1 : 2));
            $('root.btn_tongji').setLocalZOrder(tmpl == LAYERTP_TJ ? 3 : 2);
            $('root.btn_jilu').getChildByName('on').setVisible(tmpl == LAYERTP_JL);
            $('root.btn_xiangqing').getChildByName('on').setVisible(tmpl == LAYERTP_XQ);
            $('root.btn_tongji').getChildByName('on').setVisible(tmpl == LAYERTP_TJ);
            $('root.info_jilu').setVisible(tmpl == LAYERTP_JL);
            $('root.info_xiangqing').setVisible(tmpl == LAYERTP_XQ && this._isAdmin);
            $('root.info_tongji').setVisible(tmpl == LAYERTP_TJ);
            $('root.node_xiangqing').setVisible(tmpl == LAYERTP_JL || tmpl == LAYERTP_XQ);
            $('root.node_tongji').setVisible(tmpl == LAYERTP_TJ);

            $('root.mytili_0').setString(tmpl == LAYERTP_TJ ? '总体力值：' : '我的体力值：');
            if (this.changebgtxt) this.changebgtxt.setVisible(tmpl == LAYERTP_JL || tmpl == LAYERTP_XQ);

            that.layertype = tmpl;
            that._curPage = 0;
            $('root.node_xiangqing.datebg.txt').setString(that._curday + '/' + that._curmonth + '/' + that._curyear);
            if (tmpl == LAYERTP_TJ) {
                that.sendReq(that._curyear, that._curmonth, that._curday, tmpl, {
                    year: that._curyear,
                    month: that._curmonth,
                    day: that._curday
                });
            } else {
                that.sendReq(that._curyear, that._curmonth, that._curday, tmpl);
            }
            if (that._tableView) {
                that._tableView.removeFromParent();
                that._tableView = null;
            }
        },
        initMyTL: function (tiliv) {
            var clubInfo = ClubDataManager.getClubData(this._clubid);
            var hp_value = clubInfo['hp_value'];
            if (hp_value) {
                for (var i = 0; i < hp_value.length; i++) {
                    if (hp_value[i]['uid'] == gameData.uid) {
                        hp_value[i]['hp'] = tiliv;
                        break;
                    }
                }
            }
            $('root.mytili').setString(tiliv);
        },
        sendReq: function (curyear, curmonth, curday, typ, queryDataBefore) {
            if (typ == LAYERTP_TJ) {
                var para = {
                    cmd: 'QueryHpByDay',
                    club_id: this._clubid,
                    begin_time: (queryDataBefore.year + '-' + (queryDataBefore.month < 10 ? '0' + queryDataBefore.month : queryDataBefore.month) + '-' + (queryDataBefore.day < 10 ? '0' + queryDataBefore.day : queryDataBefore.day)),
                    end_time: (curyear + '-' + (curmonth < 10 ? '0' + curmonth : curmonth) + '-' + (curday < 10 ? '0' + curday : curday)),
                };
                network.send(2103, para);
                var para = {
                    cmd: 'QueryAllHp',
                    club_id: this._clubid
                };
                network.send(2103, para);
                return;
            }
            var para = {
                cmd: 'QueryHpLog',
                club_id: this._clubid,
                create_time: (curyear + '-' + (curmonth < 10 ? '0' + curmonth : curmonth) + '-' + (curday < 10 ? '0' + curday : curday)),
                limit: NumOfPage,
                skip: this._curPage * NumOfPage,
                type: (typ == LAYERTP_XQ ? 1 : 2)
            };
            //不是管理员只能查自己的
            if (!this._isAdmin) {
                para.uid = gameData.uid;
            }
            if (this._searchUid) {
                para.uid = this._searchUid;
            }
            network.send(2103, para);
            //更新我的体力值
            network.send(2103, {cmd: 'QueryHpByUid', club_id: this._clubid, uid: gameData.uid});
        },
        onEnter: function () {
            cc.Layer.prototype.onEnter.call(this);
            var that = this;
            this.list1 = cc.eventManager.addCustomListener('QueryHpLog', function (event) {
                var data = event.getUserData();
                if (data['info'] && data['info']['result'] && _.isArray(data['info']['result'])) {
                    that._resultArr = data['info']['result'];
                    that.addOtherInfo(that._resultArr);
                    $('root.noresult').setVisible(that._resultArr && that._resultArr.length == 0);
                    that.initTableView();
                    var allPage = Math.ceil(data['info']['count'] / NumOfPage);
                    that._allPage = allPage;
                    that.setNextPreBtn();
                    //合集信息
                    that.setHejiInfo(data['info']);
                }
            });
            this.list2 = cc.eventManager.addCustomListener('QueryHpByUid', function (event) {
                var data = event.getUserData();
                if (data.info && data.info.hp != null && data.info.hp != undefined) {
                    that.initMyTL(data.info.hp);
                }
            });
            this.list3 = cc.eventManager.addCustomListener('QueryHpByDay', function (event) {
                var data = event.getUserData();
                if (data.info && data.info.result) {
                    that._resultArr = data['info']['result'];
                    $('root.noresult').setVisible(that._resultArr && that._resultArr.length == 0);
                    that.initTableView();
                    if (that._resultArr && that._resultArr.length > 0) {
                        var alladd = 0;
                        var alljian = 0;
                        var allcost = 0;
                        for (var i = 0; i < that._resultArr.length; i++) {
                            alladd += that._resultArr[i]['add'];
                            allcost += that._resultArr[i]['choushui'];
                            alljian += that._resultArr[i]['sub'];
                        }
                        $('root.info_tongji.tx_alladd').setString(alladd.toFixed(1));
                        $('root.info_tongji.tx_alljian').setString(alljian.toFixed(1));
                        $('root.info_tongji.tx_allcost').setString(allcost.toFixed(1));
                    }
                }
            });
            this.list4 = cc.eventManager.addCustomListener('QueryAllHp', function (event) {
                var data = event.getUserData();
                if (data.info && data.info.all_hp >= 0) {
                    $('root.mytili').setString(data.info.all_hp);
                }
            });
        },
        //合集信息
        setHejiInfo: function (info) {
            if (this.layertype == LAYERTP_XQ) {
                if (info['total']) {
                    var value = info['total']['value'];
                    var first = info['total']['first'];
                    var last = info['total']['last'];
                    $('root.info_xiangqing.tx_roomnum').setString(info['count']);
                    $('root.info_xiangqing.tx_xiaohao').setString(value ? value.toFixed(1):'--');
                    $('root.info_xiangqing.tx_tiliqian').setString(first ? first.toFixed(1):'--');
                    $('root.info_xiangqing.tx_tilihou').setString(last ? last.toFixed(1):'--');
                } else {
                    $('root.info_xiangqing.tx_roomnum').setString(info['count']);
                    $('root.info_xiangqing.tx_xiaohao').setString('--');
                    $('root.info_xiangqing.tx_tiliqian').setString('--');
                    $('root.info_xiangqing.tx_tilihou').setString('--');
                }
            }
        },
        setNextPreBtn: function () {
            $('root.node_xiangqing.txt_page').setString((this._curPage + 1) + '/' + this._allPage);
            if (this._allPage <= 1) {
                Filter.grayScale($('root.node_xiangqing.btn_left'));
                TouchUtil.setClickDisable($('root.node_xiangqing.btn_left'), true);
                Filter.grayScale($('root.node_xiangqing.btn_right'));
                TouchUtil.setClickDisable($('root.node_xiangqing.btn_right'), true);
            } else {
                if (this._curPage == 0) {
                    Filter.grayScale($('root.node_xiangqing.btn_left'));
                    TouchUtil.setClickDisable($('root.node_xiangqing.btn_left'), true);
                } else {
                    Filter.remove($('root.node_xiangqing.btn_left'));
                    TouchUtil.setClickDisable($('root.node_xiangqing.btn_left'), false);
                }
                if (this._allPage == this._curPage + 1) {
                    Filter.grayScale($('root.node_xiangqing.btn_right'));
                    TouchUtil.setClickDisable($('root.node_xiangqing.btn_right'), true);
                } else {
                    Filter.remove($('root.node_xiangqing.btn_right'));
                    TouchUtil.setClickDisable($('root.node_xiangqing.btn_right'), false);
                }
            }

        },
        onExit: function () {
            cc.Layer.prototype.onExit.call(this);
            cc.eventManager.removeListener(this.list1);
            cc.eventManager.removeListener(this.list2);
            cc.eventManager.removeListener(this.list3);
            cc.eventManager.removeListener(this.list4);
        },
        initTableView: function () {
            if (!this._tableView) {
                if (this.layertype == LAYERTP_XQ || this.layertype == LAYERTP_TJ) {
                    $('root.table').setContentSize(cc.size(1220, 420));
                    $('root.table').setPositionY(140);
                } else {
                    $('root.table').setContentSize(cc.size(1220, 470));
                    $('root.table').setPositionY(90);
                }
                var table = $('root.table');
                var tableView = new cc.TableView(this, table.getContentSize());
                tableView.setDirection(cc.SCROLLVIEW_DIRECTION_VERTICAL);
                tableView.setVerticalFillOrder(cc.TABLEVIEW_FILL_TOPDOWN);
                tableView.setPosition(cc.p(0, 0));
                tableView.setAnchorPoint(cc.p(0, 0));
                tableView.setDelegate(this);
                table.addChild(tableView);
                tableView.retain();
                this._tableView = tableView;
            }
            this._tableView.reloadData();
        },
        tableCellTouched: function (table, cell) {
        },
        tableCellAtIndex: function (table, idx) {
            var that = this;
            var cell = table.dequeueCell();
            if (cell == null) {
                cell = new cc.TableViewCell();
                var scenetmp = null;
                if (that.layertype == LAYERTP_XQ) {
                    scenetmp = duplicateNode($('root.item_xiangqing'));
                } else if (that.layertype == LAYERTP_JL) {
                    scenetmp = duplicateNode($('root.item_jilu'));
                } else {
                    scenetmp = duplicateNode($('root.item_tongji'));
                }
                scenetmp.setPosition(cc.p(0, 90 / 2));
                scenetmp.setName('node');
                cell._node = scenetmp;
                cell.addChild(scenetmp);
            }
            this.setCellDate(cell._node, idx);
            return cell;
        },
        setCellDate: function (node, idx) {
            var that = this;
            if (that.layertype == LAYERTP_XQ) {
                var head = $('head', node);
                var nickname = $('nickname', node);
                var id = $('id', node);
                var roomid = $('roomid', node);
                var score = $('score', node);
                var xiaohao = $('xiaohao', node);
                var tiliqian = $('tiliqian', node);
                var tilihou = $('tilihou', node);
                var time = $('time', node);

                var info = this._resultArr[idx];
                loadImageToSprite(info['head'], head);
                id.setString('ID:' + info.uid);//修改人
                nickname.setString(ellipsisStr(info.username, 6));
                roomid.setString(info.room_id);
                score.setString(info.value);
                xiaohao.setString(info.choushui.toFixed(1));
                tiliqian.setString(info.before_hp.toFixed(1));
                tilihou.setString(info.after_hp.toFixed(1));
                time.ignoreContentAdaptWithSize(false);
                time.setTextAreaSize(cc.size(160, 60));
                time.setString(info.create_time);
            } else if (that.layertype == LAYERTP_JL) {
                var info = this._resultArr[idx];
                var nickname = $('nickname', node);
                var id = $('id', node);
                var nickname1 = $('nickname1', node);
                var id1 = $('id1', node);
                var tiliqian = $('tiliqian', node);
                var tilihou = $('tilihou', node);
                var time = $('time', node);

                id.setString('ID:' + info.by_user);//修改人
                nickname.setString(ellipsisStr(info.by_username, 6));
                id1.setString('ID:' + info.uid);//被修改人
                nickname1.setString(ellipsisStr(info.username, 6));
                tiliqian.setString(info.before_hp.toFixed(1));
                tilihou.setString(info.after_hp.toFixed(1));
                time.ignoreContentAdaptWithSize(false);
                time.setTextAreaSize(cc.size(160, 60));
                time.setString(info.create_time);
            } else {
                var info = this._resultArr[idx];
                var time = $('time', node);
                var alladd = $('alladd', node);
                var alljian = $('alljian', node);
                var allcost = $('allcost', node);
                time.setString(info.c_time);
                alladd.setString(info.add.toFixed(1));
                alljian.setString(info.sub.toFixed(1));
                allcost.setString(info.choushui.toFixed(1));
            }
        },
        tableCellSizeForIndex: function (table, idx) {
            return cc.size(1220, 90);
        },
        numberOfCellsInTableView: function (table) {
            return this._resultArr.length;
        },
        setDateStrTJFrom: function (year, month, day) {
            var that = this;
            $('root.node_tongji.datebg_from.txt').setString(day + '/' + month + '/' + year);
        },
        setDateStrTJTo: function (year, month, day) {
            var that = this;
            $('root.node_tongji.datebg_to.txt').setString(day + '/' + month + '/' + year);
        },
        setDateStr: function (year, month, day) {
            var that = this;
            this._curyear = year;
            this._curmonth = month;
            this._curday = day;

            that._curPage = 0;
            that.sendReq(year, month, day, that.layertype);

            $('root.node_xiangqing.datebg.txt').setString(day + '/' + month + '/' + year);
        },
        addOtherInfo: function (resultArr) {
            var that = this;
            var clubInfo = ClubDataManager.getClubData(that._clubid);
            var clubMembersInfo = clubInfo['members'];
            var getUserinfo = function (uid) {
                for (var i = 0; i < clubMembersInfo.length; i++) {
                    if (clubMembersInfo[i]['uid'] == uid) {
                        return clubMembersInfo[i];
                    }
                }
                return null;
            };
            if (resultArr) {
                for (var i = 0; i < resultArr.length; i++) {
                    if (resultArr[i]) {
                        if (that.layertype == LAYERTP_XQ) {
                            var u = getUserinfo(resultArr[i]['uid']);
                            if (u) {
                                resultArr[i]['username'] = u['name'];
                                resultArr[i]['head'] = u['head'];
                            }
                        } else if (that.layertype == LAYERTP_JL) {
                            var u = getUserinfo(resultArr[i]['uid']);
                            var u2 = getUserinfo(resultArr[i]['by_user']);
                            if (u) resultArr[i]['username'] = u['name'];
                            if (u2) resultArr[i]['by_username'] = u2['name'];
                        }
                    }
                }
            }
        },
        getYesToday: function (qian) {
            var today = new Date().getTime() - qian * 3600 * 24 * 1000;
            var yestoday = new Date(today);
            var curmonth = yestoday.getMonth() + 1;
            var curyear = yestoday.getFullYear();
            var curday = yestoday.getDate();
            return {year: curyear, month: curmonth, day: curday};
        },
    });

    exports.ClubPowerListLayer = ClubPowerListLayer;
})(window);



